package com.example.springbootfoodsafety.serviceimpl;


import com.example.springbootfoodsafety.dao.ManageDao;
import com.example.springbootfoodsafety.entity.User;
import com.example.springbootfoodsafety.po.Article;
import com.example.springbootfoodsafety.po.Speak;
import com.example.springbootfoodsafety.po.Tag;
import com.example.springbootfoodsafety.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ManageSercieImpl implements ManageService {

    @Autowired
    private ManageDao dao;

    @Override
    public boolean addUser(User user) {
        return dao.addUser(user);
    }

    @Override
    public User login(String name, String password) {
        return dao.login(name,password);
    }

    @Override
    public List<User> getAllUser() {
        return dao.getAllUser();
    }

    @Override
    public boolean deleteUser(Integer id) {
        return dao.deleteUser(id);
    }

    @Override
    public List<Article> getArticle() {
        return dao.getArticle();
    }

    @Override
    public List<Article> getTagArticle(Integer tagID) {
        return dao.getTagArticle(tagID);
    }

    @Override
    public List<Article> getLatestArticle() {
        return dao.getLatestArticle();
    }

    @Override
    public List<Article> getHeatRankingArticle() {
        return dao.getHeatRankingArticle();
    }

    @Override
    public boolean modifyHeadImg(Integer id, String modify) {
        return dao.modifyHeadImg(id,modify);
    }

    @Override
    public Integer forNameGetId(String name) {
        return dao.forNameGetId(name);
    }

    @Override
    public boolean modifyName(String name) {
        return dao.modifyName(name);
    }

    @Override
    public boolean loginStatus(Integer id) {
        return dao.loginStatus(id);
    }

    @Override
    public boolean modifyPassword(Integer id, String password) {
        return dao.modifyPassword(id,password);
    }

    @Override
    public User findPassword(Integer id, String password) {
        return dao.findPassword(id,password);
    }

    @Override
    public boolean addArticle(Article article) {
        return dao.addArticle(article);
    }

    @Override
    public boolean addSpeak(Speak speak) {
        return dao.addSpeak(speak);
    }

    @Override
    public boolean deleteSpeak(Integer id) {
        return dao.deleteSpeak(id);
    }

    @Override
    public List<Speak> getArticleSpeak(Integer id) {
        return dao.getArticleSpeak(id);
    }

    @Override
    public List<Tag> showAllTagAndCount() {
        return dao.showAllTagAndCount();
    }

    @Override
    public List<Article> showAtrcleWhereTag(Integer id) {
        return dao.showAtrcleWhereTag(id);
    }

    @Override
    public List<Tag> getAlltag() {
        return dao.getAlltag();
    }

    @Override
    public boolean addTag(String tagName) {
        return dao.addTag(tagName);
    }

    @Override
    public boolean deleteTag(int id) {
        return dao.deleteTag(id);
    }

    @Override
    public List<Article> getArticleNoStatic() {
        return dao.getArticleNoStatic();
    }

    @Override
    public boolean modifyArticleStatic(Integer id, Integer artcle_static) {
        return dao.modifyArticleStatic(id,artcle_static);
    }

    @Override
    public boolean deleteArtice(Integer id) {
        return dao.deleteArtice(id);
    }


}
